package nuc.edu.tlias.controller;

import lombok.extern.slf4j.Slf4j;
import nuc.edu.tlias.mapper.StudentMapper;
import nuc.edu.tlias.pojo.ClazzCountOption;
import nuc.edu.tlias.pojo.JobOption;
import nuc.edu.tlias.pojo.Result;
import nuc.edu.tlias.service.ClazzService;
import nuc.edu.tlias.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReprotController {
    @Autowired
    ReportService reportService;



    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption = reportService.getEmpJobData();

        return Result.success(jobOption);
    }


    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map<String,Object>> list = reportService.getEmpGenderData();

        return Result.success(list);
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map<String,Object>> list = reportService.getStudentDegreeData();
        return Result.success(list);
    }

    @GetMapping("/studentCountData")
    public Result getStudentCountData() {
        ClazzCountOption clazzCountOption = reportService.getStudentCount();
        return Result.success(clazzCountOption);
    }

}
